import http from '../utils/request';

// 获取计划项
export function fetchWorkSchedules() {
  return http({
    url: '/work_schedule_items?department=1&projects=1,2&employees=1,2&begin_time=2018-11-01&end_time=2018-11-11',
    method: 'get'
  });
}

// 增加计划项
export function createWorkSchedule(workSchedule) {
  return http({
    url: '/work_schedule_items',
    method: 'post',
    data: workSchedule
  });
}

// 更新计划项
export function updateWorkSchedule(workSchedule) {
  return http({
    url: `/work_schedule_items/${workSchedule.pkid}`,
    method: 'put',
    data: workSchedule
  });
}

// 删除计划项
export function deleteWorkSchedule(workScheduleId) {
  return http({
    url: `/work_schedule_items/${workScheduleId}`,
    method: 'delete'
  });
}
